<?php

namespace app\api\model;

use think\Model;
class Order extends Model
{

    public static function getList($where,$field,$page,$limit){
        $list = self::where($where)
            ->field($field)
            ->limit(($page-1)*$limit,$limit)
            ->order("id desc")
            ->select();
        $list = collection($list)->toArray();
        foreach($list as &$v){
            $v['addtime'] = date("Y-m-d",$v['addtime']);
        }
        $total = self::where($where)->count();
        return ['total'=>$total,'list'=>$list];
    }
}
